#!/usr/bin/python

# Usage: python Proc60List.py prefix

import os,sys

os.system('ls '+sys.argv[1]+'* > AllList.txt')

if not os.path.isfile('ProcessedList.txt'):
	open('ProcessedList.txt','w').close()

procedfile = open('ProcessedList.txt','r+')
procedlist = procedfile.readlines()

for afile in open('AllList.txt','r').readlines():
	if afile in procedlist:
		print afile.strip('\n')+' has been processed\n'
		continue
	print 'Processing '+afile
	os.system('x60cmF.sh '+afile.strip('\n'))
	procedfile.writelines(afile)

procedfile.close()

